package com.itheima.project.face.impl;

import com.itheima.project.face.TradingFace;
import com.itheima.project.pojo.Trading;
import com.itheima.project.service.ITradingService;
import com.itheima.project.utils.BeanConv;
import com.itheima.project.vo.trade.TradingVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName TradingFace.java
 * @Description 交易Face接口
 */
@Slf4j
@Component
public class TradingFaceImpl implements TradingFace {

    @Autowired
    ITradingService tradingService;

    @Override
    public List<TradingVo> findTradingByTradingState(String tradingState) {
        List<Trading>  tradings = tradingService.findTradingByTradingState(tradingState);
        return BeanConv.toBeanList(tradings,TradingVo.class);
    }
}
